package com.jt.controller;

import com.jt.service.FileService;
import com.jt.vo.EasyUIImage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 图片上传(新增商品时)
 * 说明:当点击文件上传时,
 * @author dc
 * @Classname FileController
 * @Date 2020/2/12 10:13
 */
@RestController
@RequestMapping("/pic")
public class FileController {

    @Autowired
    private FileService fileService;

    /**
     * 上传图片
     * @param uploadFile 图片
     * @return 图片封装对象
     */
    @RequestMapping("/upload")
    public EasyUIImage doUpLoadFile(MultipartFile uploadFile){
        return fileService.uploadFile(uploadFile);
    }
}
